const DbService = require('./db2');
const BaseService = require('./base');
const { TABLE_NAME } = require('../models');
const { v4 } = require('uuid');

class NoticeService extends BaseService {
  constructor() {
    super();
    this.dbService = new DbService(TABLE_NAME.notice);
  }


  async addNotice({ message, organizationId }) {
    return await this.dbService.insert({
      id: v4(),
      message,
      createAt: new Date(),
      organizationId,
    });
  }
}

module.exports = NoticeService;
